<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
        }
        div{
            width: 500px;
            height: 500px;
            background-color: #ccc;
            margin :50px;
            position: relative;
            /* display:flex;
            align-items: center;
            justify-content:center; */
        }
        p{
            width: 100px;
            height: 100px;
            background-color: blue; 
            position: absolute;
            left:50%;
            top:50%;
            margin-left:-50px;
            margin-top: -50px;
            /* top:0px;
            left:0px;
            right:0px;
            bottom:0px;
            margin:auto;
            */
        } 
    </style>
</head>
<body>
    <div>
        <p></p>
    </div>
</body>
</html>